package com.pegasus.app.PalmarHotel;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.microsoft.codepush.react.CodePush;
import com.zmxv.RNSound.RNSoundPackage;

import cn.jpush.reactnativejpush.JPushPackage;

import com.airbnb.android.react.lottie.LottiePackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.beefe.picker.PickerViewPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.rnim.rn.audio.ReactNativeAudioPackage;

import java.util.Arrays;
import java.util.List;

import com.palmarhotel.opensettings.*;

public class MainApplication extends Application implements ReactApplication {

  // 设置为 true 将不会弹出 toast
  private boolean SHUTDOWN_TOAST = false;
  // 设置为 true 将不会打印 log
  private boolean SHUTDOWN_LOG = false;

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {

    @Override

    protected String getJSBundleFile() {
      return CodePush.getJSBundleFile();
    }

    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReactNativeAudioPackage(),
          new RNSoundPackage(),
          new JPushPackage(SHUTDOWN_TOAST, SHUTDOWN_LOG),
          new LottiePackage(),
          new PickerPackage(),
          new PickerViewPackage(),
          new VectorIconsPackage(),
          new LinearGradientPackage(),
          new RNGestureHandlerPackage(),
          new OpenSettingsPackage(),
          new  CodePush("9BENl9a9S--zEG3IqyHqvVG3Ikf9-NqXnn6oJx",MainApplication.this,BuildConfig.DEBUG)

      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
